package com.yxc.elastic.plugin.lcs;

import org.elasticsearch.script.ScoreScript;
import org.elasticsearch.script.ScriptFactory;
import org.elasticsearch.search.lookup.SearchLookup;

import java.util.Map;

/**
 * @author: YXC
 * @time: 2024/1/4 10:14
 **/
public class LcsSimilarityFactory implements ScoreScript.Factory, ScriptFactory {
    @Override
    public boolean isResultDeterministic() {
        return true;
    }

    @Override
    public ScoreScript.LeafFactory newFactory(Map<String, Object> params, SearchLookup lookup) {
        return new LcsSimilarityLeafFactory(params, lookup);
    }
}
